<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: MCP23S17.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_m_c_p23_s17_8h_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">MCP23S17.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_m_c_p23_s17_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com) - &lt;http://www.fabgl.com&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">  Copyright (c) 2019-2021 Fabrizio Di Vittorio.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">  All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">* Please contact fdivitto2013@gmail.com if you need a commercial license.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">* This library and related software is available under GPL v3.</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">  FabGL is free software: you can redistribute it and/or modify</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">  it under the terms of the GNU General Public License as published by</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">  the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">  (at your option) any later version.</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">  FabGL is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">  GNU General Public License for more details.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">  You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">  along with FabGL.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;driver/spi_master.h&quot;</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="fabutils_8h.html">fabutils.h</a>&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacefabgl.html">fabgl</a> {</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#define MCP_SPI_FREQ  10000000   // it seems to work up to 23000000!! (but datasheet specifies 10000000)</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#define MCP_DMACHANNEL       2</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">#define MCP_MAXDEVICES       2</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#define MCP_PORTA            0</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">#define MCP_PORTB            1</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="preprocessor">#define MCP_A0               0</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor">#define MCP_A1               1</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">#define MCP_A2               2</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="preprocessor">#define MCP_A3               3</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor">#define MCP_A4               4</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor">#define MCP_A5               5</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor">#define MCP_A6               6</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor">#define MCP_A7               7</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">#define MCP_B0               8</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">#define MCP_B1               9</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor">#define MCP_B2              10</span></div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">#define MCP_B3              11</span></div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor">#define MCP_B4              12</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">#define MCP_B5              13</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">#define MCP_B6              14</span></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="preprocessor">#define MCP_B7              15</span></div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment">// bank 0 registers (A = reg + 0, B = reg + 1)</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="preprocessor">#define MCP_IODIR         0x00</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#define MCP_IPOL          0x02</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor">#define MCP_GPINTEN       0x04</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#define MCP_DEFVAL        0x06</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor">#define MCP_INTCON        0x08</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="preprocessor">#define MCP_IOCON         0x0A</span></div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor">#define MCP_GPPU          0x0C</span></div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor">#define MCP_INTF          0x0E</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#define MCP_INTCAP        0x10</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">#define MCP_GPIO          0x12</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="preprocessor">#define MCP_OLAT          0x14</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment">// bank 1 registers (A = reg + 0, B = reg + 0x10)</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="preprocessor">#define MCP_BNK1_IODIR    0x00</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="preprocessor">#define MCP_BNK1_IPOL     0x01</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor">#define MCP_BNK1_GPINTEN  0x02</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="preprocessor">#define MCP_BNK1_DEFVAL   0x03</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="preprocessor">#define MCP_BNK1_INTCON   0x04</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="preprocessor">#define MCP_BNK1_IOCON    0x05</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="preprocessor">#define MCP_BNK1_GPPU     0x06</span></div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="preprocessor">#define MCP_BNK1_INTF     0x07</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="preprocessor">#define MCP_BNK1_INTCAP   0x08</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="preprocessor">#define MCP_BNK1_GPIO     0x09</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="preprocessor">#define MCP_BNK1_OLAT     0x0A</span></div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="comment">// IOCON bits</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="preprocessor">#define MCP_IOCON_BANK    0x80   // Controls how the registers are addressed (0 = bank0)</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="preprocessor">#define MCP_IOCON_MIRROR  0x40   // INT Pins Mirror bit (1 = mirrored)</span></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="preprocessor">#define MCP_IOCON_SEQOP   0x20   // Sequential Operation mode bit (1 = not increment)</span></div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="preprocessor">#define MCP_IOCON_DISSLW  0x10   // Slew Rate control bit for SDA output (I2C only)</span></div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="preprocessor">#define MCP_IOCON_HAEN    0x08   // Hardware Address Enable bit</span></div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="preprocessor">#define MCP_IOCON_ODR     0x04   // Configures the INT pin as an open-drain output (1 = open-drain)</span></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="preprocessor">#define MCP_IOCON_INTPOL  0x02   // This bit sets the polarity of the INT output pin (1 = active-high)</span></div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="preprocessor">#define MCP_GPIO2REG(basereg, gpio) ((basereg) + ((gpio) &gt;&gt; 3))</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="preprocessor">#define MCP_GPIO2MASK(gpio)         (1 &lt;&lt; ((gpio) &amp; 7))</span></div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00.html#ga8389ac8ebb8a33d21364f84ddfa64c00">  126</a></span>&#160;<span class="keyword">enum class</span> <a class="code" href="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00.html#ga8389ac8ebb8a33d21364f84ddfa64c00">MCPDir</a> {</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;  <a class="code" href="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00.html#gga8389ac8ebb8a33d21364f84ddfa64c00a324118a6721dd6b8a9b9f4e327df2bf5">Input</a>,    </div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  <a class="code" href="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00.html#gga8389ac8ebb8a33d21364f84ddfa64c00a29c2c02a361c9d7028472e5d92cd4a54">Output</a>    </div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;};</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="group___enumerations_gacca22cd3567afc98587db31349ba00c7.html#gacca22cd3567afc98587db31349ba00c7">  135</a></span>&#160;<span class="keyword">enum class</span> <a class="code" href="group___enumerations_gacca22cd3567afc98587db31349ba00c7.html#gacca22cd3567afc98587db31349ba00c7">MCPIntTrigger</a> {</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  <a class="code" href="group___enumerations_gacca22cd3567afc98587db31349ba00c7.html#ggacca22cd3567afc98587db31349ba00c7a6ca33b1f5de2b2497a794ae17e9f25ed">DefaultChange</a>,    </div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;  <a class="code" href="group___enumerations_gacca22cd3567afc98587db31349ba00c7.html#ggacca22cd3567afc98587db31349ba00c7a35518ad8af987f12c3c6557003ab8da2">PreviousChange</a>    </div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;};</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17.html">  155</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_m_c_p23_s17.html">MCP23S17</a> {</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;  <a class="code" href="classfabgl_1_1_m_c_p23_s17.html">MCP23S17</a>();</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;  ~<a class="code" href="classfabgl_1_1_m_c_p23_s17.html">MCP23S17</a>();</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_ab205baa284c3197865fef390a0304355.html#ab205baa284c3197865fef390a0304355">begin</a>(<span class="keywordtype">int</span> MISO = -1, <span class="keywordtype">int</span> MOSI = -1, <span class="keywordtype">int</span> CLK = -1, <span class="keywordtype">int</span> CS = -1, <span class="keywordtype">int</span> CSActiveState = -1, <span class="keywordtype">int</span> host = HSPI_HOST);</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_aaf81d3fdaf258088d7692fa70cece087.html#aaf81d3fdaf258088d7692fa70cece087">end</a>();</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_a4a47f12debf6d5d7273c3e5fb360417a.html#a4a47f12debf6d5d7273c3e5fb360417a">  188</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a4a47f12debf6d5d7273c3e5fb360417a.html#a4a47f12debf6d5d7273c3e5fb360417a">available</a>()     { <span class="keywordflow">return</span> m_SPIDevHandle != <span class="keyword">nullptr</span>; }</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a51561306fb349bc2978919958cbfda52.html#a51561306fb349bc2978919958cbfda52">initDevice</a>(uint8_t hwAddr);</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a757ff4f7b16a40109207981a8449b68b.html#a757ff4f7b16a40109207981a8449b68b">writeReg</a>(uint8_t addr, uint8_t value, uint8_t hwAddr = 0);</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;  uint8_t <a class="code" href="classfabgl_1_1_m_c_p23_s17_ae09cec89e003ed8907ffcae9afcc86aa.html#ae09cec89e003ed8907ffcae9afcc86aa">readReg</a>(uint8_t addr, uint8_t hwAddr = 0);</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a29921f863c2024cd62bb9596f93f9f0e.html#a29921f863c2024cd62bb9596f93f9f0e">writeReg16</a>(uint8_t addr, uint16_t value, uint8_t hwAddr = 0);</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;  uint16_t <a class="code" href="classfabgl_1_1_m_c_p23_s17_a6ce7f6e8f2563790be2cb010d99a2947.html#a6ce7f6e8f2563790be2cb010d99a2947">readReg16</a>(uint8_t addr, uint8_t hwAddr = 0);</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a193701415e90c6513fa98fd5303ad8c8.html#a193701415e90c6513fa98fd5303ad8c8">enableINTMirroring</a>(<span class="keywordtype">bool</span> value, uint8_t hwAddr = 0);</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_abab6c21e5930b8616afec12a6b0778ca.html#abab6c21e5930b8616afec12a6b0778ca">enableINTOpenDrain</a>(<span class="keywordtype">bool</span> value, uint8_t hwAddr = 0);</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a9c2b2fb01c26e9d23bf985a960157429.html#a9c2b2fb01c26e9d23bf985a960157429">setINTActiveHigh</a>(<span class="keywordtype">bool</span> value, uint8_t hwAddr = 0);</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;</div><div class="line"><a name="l00303"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_a1dfc220a260c3445263d1c3f64012df0.html#a1dfc220a260c3445263d1c3f64012df0">  303</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a1dfc220a260c3445263d1c3f64012df0.html#a1dfc220a260c3445263d1c3f64012df0">setPortDir</a>(<span class="keywordtype">int</span> port, uint8_t value, uint8_t hwAddr = 0)           { <a class="code" href="classfabgl_1_1_m_c_p23_s17_a757ff4f7b16a40109207981a8449b68b.html#a757ff4f7b16a40109207981a8449b68b">writeReg</a>(MCP_IODIR + port, value, hwAddr); }</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;</div><div class="line"><a name="l00313"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_abb39053b2749aab18f6457ea2bfcfd5f.html#abb39053b2749aab18f6457ea2bfcfd5f">  313</a></span>&#160;  uint8_t <a class="code" href="classfabgl_1_1_m_c_p23_s17_abb39053b2749aab18f6457ea2bfcfd5f.html#abb39053b2749aab18f6457ea2bfcfd5f">getPortDir</a>(<span class="keywordtype">int</span> port, uint8_t hwAddr = 0)                       { <span class="keywordflow">return</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_ae09cec89e003ed8907ffcae9afcc86aa.html#ae09cec89e003ed8907ffcae9afcc86aa">readReg</a>(MCP_IODIR + port, hwAddr); }</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;</div><div class="line"><a name="l00322"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_a11455dbe62297bf55558ada2ae149cbd.html#a11455dbe62297bf55558ada2ae149cbd">  322</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a11455dbe62297bf55558ada2ae149cbd.html#a11455dbe62297bf55558ada2ae149cbd">setPortInputPolarity</a>(<span class="keywordtype">int</span> port, uint8_t value, uint8_t hwAddr = 0) { <a class="code" href="classfabgl_1_1_m_c_p23_s17_a757ff4f7b16a40109207981a8449b68b.html#a757ff4f7b16a40109207981a8449b68b">writeReg</a>(MCP_IPOL + port, value, hwAddr); }</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;</div><div class="line"><a name="l00336"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_ad87ef9d4b57ebfecc575f6f2147f162a.html#ad87ef9d4b57ebfecc575f6f2147f162a">  336</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_ad87ef9d4b57ebfecc575f6f2147f162a.html#ad87ef9d4b57ebfecc575f6f2147f162a">enablePortPullUp</a>(<span class="keywordtype">int</span> port, uint8_t value, uint8_t hwAddr = 0)     { <a class="code" href="classfabgl_1_1_m_c_p23_s17_a757ff4f7b16a40109207981a8449b68b.html#a757ff4f7b16a40109207981a8449b68b">writeReg</a>(MCP_GPPU + port, value, hwAddr); }</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;</div><div class="line"><a name="l00350"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_a18cd651a9bdeba442f663bbd4d6e746a.html#a18cd651a9bdeba442f663bbd4d6e746a">  350</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a18cd651a9bdeba442f663bbd4d6e746a.html#a18cd651a9bdeba442f663bbd4d6e746a">writePort</a>(<span class="keywordtype">int</span> port, uint8_t value, uint8_t hwAddr = 0)            { <a class="code" href="classfabgl_1_1_m_c_p23_s17_a757ff4f7b16a40109207981a8449b68b.html#a757ff4f7b16a40109207981a8449b68b">writeReg</a>(MCP_OLAT + port, value, hwAddr); }</div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;</div><div class="line"><a name="l00365"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_af5e184c08c0ef35a04b44fb54c323480.html#af5e184c08c0ef35a04b44fb54c323480">  365</a></span>&#160;  uint8_t <a class="code" href="classfabgl_1_1_m_c_p23_s17_af5e184c08c0ef35a04b44fb54c323480.html#af5e184c08c0ef35a04b44fb54c323480">readPort</a>(<span class="keywordtype">int</span> port, uint8_t hwAddr = 0)                         { <span class="keywordflow">return</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_ae09cec89e003ed8907ffcae9afcc86aa.html#ae09cec89e003ed8907ffcae9afcc86aa">readReg</a>(MCP_GPIO + port, hwAddr); }</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;</div><div class="line"><a name="l00378"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_a5b074f638d78ad71eb85b4eaa093e002.html#a5b074f638d78ad71eb85b4eaa093e002">  378</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a5b074f638d78ad71eb85b4eaa093e002.html#a5b074f638d78ad71eb85b4eaa093e002">writePort16</a>(uint16_t value, uint8_t hwAddr = 0)                   { <a class="code" href="classfabgl_1_1_m_c_p23_s17_a29921f863c2024cd62bb9596f93f9f0e.html#a29921f863c2024cd62bb9596f93f9f0e">writeReg16</a>(MCP_OLAT, value, hwAddr); }</div><div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;</div><div class="line"><a name="l00392"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_a65b2c8f8f694f5076c43802311d7457a.html#a65b2c8f8f694f5076c43802311d7457a">  392</a></span>&#160;  uint16_t <a class="code" href="classfabgl_1_1_m_c_p23_s17_a65b2c8f8f694f5076c43802311d7457a.html#a65b2c8f8f694f5076c43802311d7457a">readPort16</a>(uint8_t hwAddr = 0)                                { <span class="keywordflow">return</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a6ce7f6e8f2563790be2cb010d99a2947.html#a6ce7f6e8f2563790be2cb010d99a2947">readReg16</a>(MCP_GPIO, hwAddr); }</div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;</div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;</div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a0f75f7eae543df606255fb17aaff4fcd.html#a0f75f7eae543df606255fb17aaff4fcd">configureGPIO</a>(<span class="keywordtype">int</span> gpio, <a class="code" href="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00.html#ga8389ac8ebb8a33d21364f84ddfa64c00">MCPDir</a> dir, <span class="keywordtype">bool</span> pullup = <span class="keyword">false</span>, uint8_t hwAddr = 0);</div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;</div><div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a1762512f6b6a1b4149af5778d048fa26.html#a1762512f6b6a1b4149af5778d048fa26">writeGPIO</a>(<span class="keywordtype">int</span> gpio, <span class="keywordtype">bool</span> value, uint8_t hwAddr = 0);</div><div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;</div><div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_afe1923d1107ce527071d3d0b0dc50b3a.html#afe1923d1107ce527071d3d0b0dc50b3a">readGPIO</a>(<span class="keywordtype">int</span> gpio, uint8_t hwAddr = 0);</div><div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;</div><div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;</div><div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;</div><div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;</div><div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_ac85086c7d62df2eace4d8fa2be5a6987.html#ac85086c7d62df2eace4d8fa2be5a6987">enableInterrupt</a>(<span class="keywordtype">int</span> gpio, <a class="code" href="group___enumerations_gacca22cd3567afc98587db31349ba00c7.html#gacca22cd3567afc98587db31349ba00c7">MCPIntTrigger</a> trigger, <span class="keywordtype">bool</span> defaultValue = <span class="keyword">false</span>, uint8_t hwAddr = 0);</div><div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;</div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_af8a4b526fa1bbd378c9a65410795159c.html#af8a4b526fa1bbd378c9a65410795159c">disableInterrupt</a>(<span class="keywordtype">int</span> gpio, uint8_t hwAddr = 0);</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;</div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;</div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;</div><div class="line"><a name="l00491"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_a34e4bc492e58778c7d864db2cf4ec57d.html#a34e4bc492e58778c7d864db2cf4ec57d">  491</a></span>&#160;  uint8_t <a class="code" href="classfabgl_1_1_m_c_p23_s17_a34e4bc492e58778c7d864db2cf4ec57d.html#a34e4bc492e58778c7d864db2cf4ec57d">getPortIntFlags</a>(<span class="keywordtype">int</span> port, uint8_t hwAddr = 0)                  { <span class="keywordflow">return</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_ae09cec89e003ed8907ffcae9afcc86aa.html#ae09cec89e003ed8907ffcae9afcc86aa">readReg</a>(MCP_INTF + port, hwAddr); }</div><div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;</div><div class="line"><a name="l00501"></a><span class="lineno"><a class="line" href="classfabgl_1_1_m_c_p23_s17_a51f318b3a55f21c122f9090d60549306.html#a51f318b3a55f21c122f9090d60549306">  501</a></span>&#160;  uint8_t <a class="code" href="classfabgl_1_1_m_c_p23_s17_a51f318b3a55f21c122f9090d60549306.html#a51f318b3a55f21c122f9090d60549306">getPortIntCaptured</a>(<span class="keywordtype">int</span> port, uint8_t hwAddr = 0)               { <span class="keywordflow">return</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_ae09cec89e003ed8907ffcae9afcc86aa.html#ae09cec89e003ed8907ffcae9afcc86aa">readReg</a>(MCP_INTCAP + port, hwAddr); }</div><div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;</div><div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;</div><div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;</div><div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;</div><div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_a18cd651a9bdeba442f663bbd4d6e746a.html#a18cd651a9bdeba442f663bbd4d6e746a">writePort</a>(<span class="keywordtype">int</span> port, <span class="keywordtype">void</span> <span class="keyword">const</span> * buffer, <span class="keywordtype">size_t</span> length, uint8_t hwAddr = 0);</div><div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;</div><div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_m_c_p23_s17_af5e184c08c0ef35a04b44fb54c323480.html#af5e184c08c0ef35a04b44fb54c323480">readPort</a>(<span class="keywordtype">int</span> port, <span class="keywordtype">void</span> * buffer, <span class="keywordtype">size_t</span> length, uint8_t hwAddr = 0);</div><div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;</div><div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;</div><div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;</div><div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;  <span class="keywordtype">bool</span> SPIBegin(<span class="keywordtype">int</span> CSActiveState);</div><div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;  <span class="keywordtype">void</span> SPIEnd();</div><div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;</div><div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;  gpio_num_t          m_MISO;</div><div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;  gpio_num_t          m_MOSI;</div><div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;  gpio_num_t          m_CLK;</div><div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;  gpio_num_t          m_CS;</div><div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;  spi_host_device_t   m_SPIHost;</div><div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;</div><div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;  spi_device_handle_t m_SPIDevHandle;</div><div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;</div><div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;  <span class="comment">// cached registers</span></div><div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;  uint8_t             m_IOCON[MCP_MAXDEVICES];</div><div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;};</div><div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;</div><div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;</div><div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;</div><div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;</div><div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;</div><div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;</div><div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;</div><div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;</div><div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;</div><div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;} <span class="comment">// fabgl namespace</span></div><div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;</div><div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a5b074f638d78ad71eb85b4eaa093e002_html_a5b074f638d78ad71eb85b4eaa093e002"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a5b074f638d78ad71eb85b4eaa093e002.html#a5b074f638d78ad71eb85b4eaa093e002">fabgl::MCP23S17::writePort16</a></div><div class="ttdeci">void writePort16(uint16_t value, uint8_t hwAddr=0)</div><div class="ttdoc">Sets status of output pins of combined port A and B. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00378">MCP23S17.h:378</a></div></div>
<div class="ttc" id="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00_html_gga8389ac8ebb8a33d21364f84ddfa64c00a29c2c02a361c9d7028472e5d92cd4a54"><div class="ttname"><a href="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00.html#gga8389ac8ebb8a33d21364f84ddfa64c00a29c2c02a361c9d7028472e5d92cd4a54">fabgl::MCPDir::Output</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_afe1923d1107ce527071d3d0b0dc50b3a_html_afe1923d1107ce527071d3d0b0dc50b3a"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_afe1923d1107ce527071d3d0b0dc50b3a.html#afe1923d1107ce527071d3d0b0dc50b3a">fabgl::MCP23S17::readGPIO</a></div><div class="ttdeci">bool readGPIO(int gpio, uint8_t hwAddr=0)</div><div class="ttdoc">Reads input status of a pin. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00274">MCP23S17.cpp:274</a></div></div>
<div class="ttc" id="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00_html_gga8389ac8ebb8a33d21364f84ddfa64c00a324118a6721dd6b8a9b9f4e327df2bf5"><div class="ttname"><a href="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00.html#gga8389ac8ebb8a33d21364f84ddfa64c00a324118a6721dd6b8a9b9f4e327df2bf5">fabgl::MCPDir::Input</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a51f318b3a55f21c122f9090d60549306_html_a51f318b3a55f21c122f9090d60549306"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a51f318b3a55f21c122f9090d60549306.html#a51f318b3a55f21c122f9090d60549306">fabgl::MCP23S17::getPortIntCaptured</a></div><div class="ttdeci">uint8_t getPortIntCaptured(int port, uint8_t hwAddr=0)</div><div class="ttdoc">Reads status of input port when last interrupt has been triggered. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00501">MCP23S17.h:501</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a11455dbe62297bf55558ada2ae149cbd_html_a11455dbe62297bf55558ada2ae149cbd"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a11455dbe62297bf55558ada2ae149cbd.html#a11455dbe62297bf55558ada2ae149cbd">fabgl::MCP23S17::setPortInputPolarity</a></div><div class="ttdeci">void setPortInputPolarity(int port, uint8_t value, uint8_t hwAddr=0)</div><div class="ttdoc">Sets input polarity. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00322">MCP23S17.h:322</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a29921f863c2024cd62bb9596f93f9f0e_html_a29921f863c2024cd62bb9596f93f9f0e"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a29921f863c2024cd62bb9596f93f9f0e.html#a29921f863c2024cd62bb9596f93f9f0e">fabgl::MCP23S17::writeReg16</a></div><div class="ttdeci">void writeReg16(uint8_t addr, uint16_t value, uint8_t hwAddr=0)</div><div class="ttdoc">Writes 16 bit value to two consecutive registers. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00193">MCP23S17.cpp:193</a></div></div>
<div class="ttc" id="group___enumerations_gacca22cd3567afc98587db31349ba00c7_html_ggacca22cd3567afc98587db31349ba00c7a35518ad8af987f12c3c6557003ab8da2"><div class="ttname"><a href="group___enumerations_gacca22cd3567afc98587db31349ba00c7.html#ggacca22cd3567afc98587db31349ba00c7a35518ad8af987f12c3c6557003ab8da2">fabgl::MCPIntTrigger::PreviousChange</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_ad87ef9d4b57ebfecc575f6f2147f162a_html_ad87ef9d4b57ebfecc575f6f2147f162a"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_ad87ef9d4b57ebfecc575f6f2147f162a.html#ad87ef9d4b57ebfecc575f6f2147f162a">fabgl::MCP23S17::enablePortPullUp</a></div><div class="ttdeci">void enablePortPullUp(int port, uint8_t value, uint8_t hwAddr=0)</div><div class="ttdoc">Enables/disables port pull-ups. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00336">MCP23S17.h:336</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_ae09cec89e003ed8907ffcae9afcc86aa_html_ae09cec89e003ed8907ffcae9afcc86aa"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_ae09cec89e003ed8907ffcae9afcc86aa.html#ae09cec89e003ed8907ffcae9afcc86aa">fabgl::MCP23S17::readReg</a></div><div class="ttdeci">uint8_t readReg(uint8_t addr, uint8_t hwAddr=0)</div><div class="ttdoc">Reads 8 bit value from an internal register. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00171">MCP23S17.cpp:171</a></div></div>
<div class="ttc" id="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00_html_ga8389ac8ebb8a33d21364f84ddfa64c00"><div class="ttname"><a href="group___enumerations_ga8389ac8ebb8a33d21364f84ddfa64c00.html#ga8389ac8ebb8a33d21364f84ddfa64c00">fabgl::MCPDir</a></div><div class="ttdeci">MCPDir</div><div class="ttdoc">Represents GPIO directioon. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00126">MCP23S17.h:126</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_af5e184c08c0ef35a04b44fb54c323480_html_af5e184c08c0ef35a04b44fb54c323480"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_af5e184c08c0ef35a04b44fb54c323480.html#af5e184c08c0ef35a04b44fb54c323480">fabgl::MCP23S17::readPort</a></div><div class="ttdeci">uint8_t readPort(int port, uint8_t hwAddr=0)</div><div class="ttdoc">Gets status of input pins of specified port. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00365">MCP23S17.h:365</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a4a47f12debf6d5d7273c3e5fb360417a_html_a4a47f12debf6d5d7273c3e5fb360417a"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a4a47f12debf6d5d7273c3e5fb360417a.html#a4a47f12debf6d5d7273c3e5fb360417a">fabgl::MCP23S17::available</a></div><div class="ttdeci">bool available()</div><div class="ttdoc">Determines MCP23S17 availability. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00188">MCP23S17.h:188</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_ab205baa284c3197865fef390a0304355_html_ab205baa284c3197865fef390a0304355"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_ab205baa284c3197865fef390a0304355.html#ab205baa284c3197865fef390a0304355">fabgl::MCP23S17::begin</a></div><div class="ttdeci">bool begin(int MISO=-1, int MOSI=-1, int CLK=-1, int CS=-1, int CSActiveState=-1, int host=HSPI_HOST)</div><div class="ttdoc">Initializes MCP23S17 driver. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00050">MCP23S17.cpp:50</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a1762512f6b6a1b4149af5778d048fa26_html_a1762512f6b6a1b4149af5778d048fa26"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a1762512f6b6a1b4149af5778d048fa26.html#a1762512f6b6a1b4149af5778d048fa26">fabgl::MCP23S17::writeGPIO</a></div><div class="ttdeci">void writeGPIO(int gpio, bool value, uint8_t hwAddr=0)</div><div class="ttdoc">Sets output status of a pin. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00265">MCP23S17.cpp:265</a></div></div>
<div class="ttc" id="fabutils_8h_html"><div class="ttname"><a href="fabutils_8h.html">fabutils.h</a></div><div class="ttdoc">This file contains some utility classes and functions. </div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_af8a4b526fa1bbd378c9a65410795159c_html_af8a4b526fa1bbd378c9a65410795159c"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_af8a4b526fa1bbd378c9a65410795159c.html#af8a4b526fa1bbd378c9a65410795159c">fabgl::MCP23S17::disableInterrupt</a></div><div class="ttdeci">void disableInterrupt(int gpio, uint8_t hwAddr=0)</div><div class="ttdoc">Disables any interrupt on the specified pin. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00297">MCP23S17.cpp:297</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_aaf81d3fdaf258088d7692fa70cece087_html_aaf81d3fdaf258088d7692fa70cece087"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_aaf81d3fdaf258088d7692fa70cece087.html#aaf81d3fdaf258088d7692fa70cece087">fabgl::MCP23S17::end</a></div><div class="ttdeci">void end()</div><div class="ttdoc">Deinitializes MCP23S17 driver. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00112">MCP23S17.cpp:112</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_abb39053b2749aab18f6457ea2bfcfd5f_html_abb39053b2749aab18f6457ea2bfcfd5f"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_abb39053b2749aab18f6457ea2bfcfd5f.html#abb39053b2749aab18f6457ea2bfcfd5f">fabgl::MCP23S17::getPortDir</a></div><div class="ttdeci">uint8_t getPortDir(int port, uint8_t hwAddr=0)</div><div class="ttdoc">Gets port direction. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00313">MCP23S17.h:313</a></div></div>
<div class="ttc" id="namespacefabgl_html"><div class="ttname"><a href="namespacefabgl.html">fabgl</a></div><div class="ttdef"><b>Definition:</b> <a href="canvas_8cpp_source.html#l00036">canvas.cpp:36</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a1dfc220a260c3445263d1c3f64012df0_html_a1dfc220a260c3445263d1c3f64012df0"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a1dfc220a260c3445263d1c3f64012df0.html#a1dfc220a260c3445263d1c3f64012df0">fabgl::MCP23S17::setPortDir</a></div><div class="ttdeci">void setPortDir(int port, uint8_t value, uint8_t hwAddr=0)</div><div class="ttdoc">Sets port direction. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00303">MCP23S17.h:303</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a757ff4f7b16a40109207981a8449b68b_html_a757ff4f7b16a40109207981a8449b68b"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a757ff4f7b16a40109207981a8449b68b.html#a757ff4f7b16a40109207981a8449b68b">fabgl::MCP23S17::writeReg</a></div><div class="ttdeci">void writeReg(uint8_t addr, uint8_t value, uint8_t hwAddr=0)</div><div class="ttdoc">Writes 8 bit value to an internal register. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00154">MCP23S17.cpp:154</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_abab6c21e5930b8616afec12a6b0778ca_html_abab6c21e5930b8616afec12a6b0778ca"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_abab6c21e5930b8616afec12a6b0778ca.html#abab6c21e5930b8616afec12a6b0778ca">fabgl::MCP23S17::enableINTOpenDrain</a></div><div class="ttdeci">void enableINTOpenDrain(bool value, uint8_t hwAddr=0)</div><div class="ttdoc">Enables/disables the INT pin open-drain. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00238">MCP23S17.cpp:238</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_html"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17.html">fabgl::MCP23S17</a></div><div class="ttdoc">MCP23S17 driver. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00155">MCP23S17.h:155</a></div></div>
<div class="ttc" id="group___enumerations_gacca22cd3567afc98587db31349ba00c7_html_gacca22cd3567afc98587db31349ba00c7"><div class="ttname"><a href="group___enumerations_gacca22cd3567afc98587db31349ba00c7.html#gacca22cd3567afc98587db31349ba00c7">fabgl::MCPIntTrigger</a></div><div class="ttdeci">MCPIntTrigger</div><div class="ttdoc">Represents interrupt trigger mode. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00135">MCP23S17.h:135</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a65b2c8f8f694f5076c43802311d7457a_html_a65b2c8f8f694f5076c43802311d7457a"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a65b2c8f8f694f5076c43802311d7457a.html#a65b2c8f8f694f5076c43802311d7457a">fabgl::MCP23S17::readPort16</a></div><div class="ttdeci">uint16_t readPort16(uint8_t hwAddr=0)</div><div class="ttdoc">Gets status of input pins of combined port A and B. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00392">MCP23S17.h:392</a></div></div>
<div class="ttc" id="group___enumerations_gacca22cd3567afc98587db31349ba00c7_html_ggacca22cd3567afc98587db31349ba00c7a6ca33b1f5de2b2497a794ae17e9f25ed"><div class="ttname"><a href="group___enumerations_gacca22cd3567afc98587db31349ba00c7.html#ggacca22cd3567afc98587db31349ba00c7a6ca33b1f5de2b2497a794ae17e9f25ed">fabgl::MCPIntTrigger::DefaultChange</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a9c2b2fb01c26e9d23bf985a960157429_html_a9c2b2fb01c26e9d23bf985a960157429"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a9c2b2fb01c26e9d23bf985a960157429.html#a9c2b2fb01c26e9d23bf985a960157429">fabgl::MCP23S17::setINTActiveHigh</a></div><div class="ttdeci">void setINTActiveHigh(bool value, uint8_t hwAddr=0)</div><div class="ttdoc">Sets the polarity of the INT pins. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00244">MCP23S17.cpp:244</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a0f75f7eae543df606255fb17aaff4fcd_html_a0f75f7eae543df606255fb17aaff4fcd"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a0f75f7eae543df606255fb17aaff4fcd.html#a0f75f7eae543df606255fb17aaff4fcd">fabgl::MCP23S17::configureGPIO</a></div><div class="ttdeci">void configureGPIO(int gpio, MCPDir dir, bool pullup=false, uint8_t hwAddr=0)</div><div class="ttdoc">Configure a pin direction and pullup. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00250">MCP23S17.cpp:250</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a18cd651a9bdeba442f663bbd4d6e746a_html_a18cd651a9bdeba442f663bbd4d6e746a"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a18cd651a9bdeba442f663bbd4d6e746a.html#a18cd651a9bdeba442f663bbd4d6e746a">fabgl::MCP23S17::writePort</a></div><div class="ttdeci">void writePort(int port, uint8_t value, uint8_t hwAddr=0)</div><div class="ttdoc">Sets status of output pins of specified port. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00350">MCP23S17.h:350</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a51561306fb349bc2978919958cbfda52_html_a51561306fb349bc2978919958cbfda52"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a51561306fb349bc2978919958cbfda52.html#a51561306fb349bc2978919958cbfda52">fabgl::MCP23S17::initDevice</a></div><div class="ttdeci">void initDevice(uint8_t hwAddr)</div><div class="ttdoc">Initializes additional MCP23S17 devices connected to the same SPI bus but with a different hardware a...</div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00105">MCP23S17.cpp:105</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a193701415e90c6513fa98fd5303ad8c8_html_a193701415e90c6513fa98fd5303ad8c8"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a193701415e90c6513fa98fd5303ad8c8.html#a193701415e90c6513fa98fd5303ad8c8">fabgl::MCP23S17::enableINTMirroring</a></div><div class="ttdeci">void enableINTMirroring(bool value, uint8_t hwAddr=0)</div><div class="ttdoc">Enables/disables INTs pins mirroring. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00232">MCP23S17.cpp:232</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a6ce7f6e8f2563790be2cb010d99a2947_html_a6ce7f6e8f2563790be2cb010d99a2947"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a6ce7f6e8f2563790be2cb010d99a2947.html#a6ce7f6e8f2563790be2cb010d99a2947">fabgl::MCP23S17::readReg16</a></div><div class="ttdeci">uint16_t readReg16(uint8_t addr, uint8_t hwAddr=0)</div><div class="ttdoc">Reads 16 bit value from two consecutive registers. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00210">MCP23S17.cpp:210</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_a34e4bc492e58778c7d864db2cf4ec57d_html_a34e4bc492e58778c7d864db2cf4ec57d"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_a34e4bc492e58778c7d864db2cf4ec57d.html#a34e4bc492e58778c7d864db2cf4ec57d">fabgl::MCP23S17::getPortIntFlags</a></div><div class="ttdeci">uint8_t getPortIntFlags(int port, uint8_t hwAddr=0)</div><div class="ttdoc">Reads interrupt flags for the specified port. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8h_source.html#l00491">MCP23S17.h:491</a></div></div>
<div class="ttc" id="classfabgl_1_1_m_c_p23_s17_ac85086c7d62df2eace4d8fa2be5a6987_html_ac85086c7d62df2eace4d8fa2be5a6987"><div class="ttname"><a href="classfabgl_1_1_m_c_p23_s17_ac85086c7d62df2eace4d8fa2be5a6987.html#ac85086c7d62df2eace4d8fa2be5a6987">fabgl::MCP23S17::enableInterrupt</a></div><div class="ttdeci">void enableInterrupt(int gpio, MCPIntTrigger trigger, bool defaultValue=false, uint8_t hwAddr=0)</div><div class="ttdoc">Enables interrupt on the specific pin. </div><div class="ttdef"><b>Definition:</b> <a href="_m_c_p23_s17_8cpp_source.html#l00280">MCP23S17.cpp:280</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_82e8a5453e51b0b6168db3257bd0eaab.html">devdrivers</a></li><li class="navelem"><a class="el" href="_m_c_p23_s17_8h.html">MCP23S17.h</a></li>
    <li class="footer">Generated on Mon Aug 2 2021 07:08:03 for FabGL by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
